package com.ccf.business.etl.model.neo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

@ApiModel(value = "图谱实体对象")
@Accessors(chain = true)
@Data
public class NeoNode {

    public final static String SUBJECT = "subject";
    public final static String SYNONYM = "synonym";

    @ApiModelProperty(value = "图谱实体ID")
    private String id;

    @ApiModelProperty(value = "图谱模型")
    private String model= "node";

    @ApiModelProperty(value = "图谱实体名称")
    private String name;

    @ApiModelProperty(value = "图谱实体UI类型")
    private String type = "circle";

    @ApiModelProperty(value = "图谱实体UI样式")
    private NeoStyle style;

    @ApiModelProperty(value = "节点类型")
    private String nodeType;

    @ApiModelProperty(value = "父节点ID")
    private String pid;

    @ApiModelProperty(value = "父节点名称")
    private String parentName;

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (this == obj) {
            return true;
        }

        if (obj instanceof NeoNode) {
            NeoNode vo = (NeoNode) obj;
            return vo.getId().equals(this.getId());
        }

        return false;
    }

    @Override
    public int hashCode() {
        return getId().hashCode();
    }
}
